package com.shawn.spring.boot.flowable.handler;

import com.shawn.spring.boot.flowable.service.UserService;
import org.flowable.engine.delegate.DelegateExecution;
import org.flowable.engine.delegate.JavaDelegate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class HolidayApprovalHandler implements JavaDelegate {

  @Autowired private UserService userService;

  @Override
  public void execute(DelegateExecution execution) {
    Object applicantId = execution.getVariable("applicantId");

    // 往人事系统发送rest api（年假类型，年假天数-1）

    // 邮件告诉申请人，你可以请假了  jms java message service
    System.out.println(applicantId);
  }
}
